#include "../../client/Rpc_client.hpp"
#include <thread>

void Callback(const std::string& topic_name,const std::string& msg)
{
    LOG(INFO,"向 %s 主题发出一条消息，我要做出响应，响应是下一行的打印消息",topic_name.c_str());
    LOG(INFO,"消息是: %s",msg.c_str());
}
int main()
{
    auto topic_client = std::make_shared<ns_rpc_client::TopicClient>("127.0.0.1",8080);
    bool ret = topic_client->Create("new");
    if(ret == false)
        LOG(ERROR,"创建new主题失败");

    // topic_client->Subscribe("new",Callback);
    // std::this_thread::sleep_for(std::chrono::seconds(10));
    // topic_client->Shutdown();
    return 0;
}